<?php /* 我的房间 */
require_once('conn.inc.php');
@$logintime	=		time();										//登录时间
@$conn		=		mysql_connect($db_host,$db_user,$db_pwd);
mysql_query("set names 'utf8'");
mysql_select_db($db_name);

// @$id 	=	 	$_POST["id"];
@$id 	=	42;
@$find	=	"select * from hometeam where fid='$id' && state='1' ";		
$result = mysql_query($find);
$num_rows = mysql_num_rows($result);
if ($num_rows == 1) {
	$row= mysql_fetch_array($result);
	$hid = $row['hid'];
	
	@$sql	=	"select * from home where hid='$hid' && state='1'";
	$results = mysql_query($sql);
	@$sql2	=	"select * from hometeam where hid='$hid' && state='1'";
	$rsql2 = mysql_query($sql2);
	$nsql2 = mysql_num_rows($rsql2);
	
	if($row = mysql_fetch_row($results)){
		$json = array(							//返回用户信息
				'code'			=>0,
				'topic'			=>$row[2],
				'roomname'		=>$row[3],
				'nop'			=>$row[4],
				'place'			=>$row[5],
				'activitytime'	=>$row[6],
				'about'			=>$row[8],
				'pay'			=>$row[10],
				'pic'			=>$row[12],
				'ycjrs'			=>$nsql2			//已参加人数
		);
	}else{
		$json = array(
				'code'		=>250,
				'rand_num'	=>date('Y/m/d H:i:s')
		);
	}
	echo json_encode($json);
}else {
	$rc = array('code'=>-1);
	echo json_encode($rc);										//没有组局
}
mysql_close();